import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";

import type { RootState, AppDispatch } from "./store";

// 封装本文件的目的是，为了使用类型

// 将两个带有类型的hook导出
export const useAppDispatch: () => AppDispatch = useDispatch;
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

/**
 *
 * const dispatch  = useDispatch();
 * const value = useSelector(state => state.system.value)
 *
 */
